package com.xiaoyu.cloudmusic.service;

import com.xiaoyu.cloudmusic.dao.AccountsMapper;
import com.xiaoyu.cloudmusic.pojo.Account;
import com.xiaoyu.cloudmusic.pojo.PlayListDetail;
import com.xiaoyu.cloudmusic.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountsServiceImpl implements AccountsService{
    @Autowired
    AccountsMapper accountsMapper;

    @Override
    public Account findOne(String account, String password) {
        return accountsMapper.findOne(account,password);
    }

    @Override
    public int addAccount(String account, String password,String uuid) {
        return accountsMapper.addAccount(account,password,uuid);
    }

    @Override
    public int addUserInfo(UserInfo userInfo) {
        return accountsMapper.addUserInfo(userInfo);
    }

    @Override
    public UserInfo getUserInfoByUUID(String uuid) {
        return accountsMapper.getUserInfoByUUID(uuid);
    }

    @Override
    public int upDateUserInfo(UserInfo userInfo) {
        return accountsMapper.upDateUserInfo(userInfo);
    }

    @Override
    public int updateAvatar(String photoPath, String uuid) {
        return accountsMapper.updateAvatar(photoPath,uuid);
    }

    @Override
    public UserInfo findUserInfoByUUID(String uuid) {
        return accountsMapper.findUserInfoByUUID(uuid);
    }

    @Override
    public List<PlayListDetail> getUserPlayList(String uuid) {
        return accountsMapper.getUserPlayList(uuid);
    }


}
